package com.example.a22310.myapplication.Activity;


import android.content.Intent;
import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;

import com.example.a22310.myapplication.Beans.Race;
import com.example.a22310.myapplication.databinding.GameDetailBinding;
import com.squareup.picasso.Picasso;

public class GameDatail extends AppCompatActivity {
    private Race.RacelistBean race;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        GameDetailBinding binding = DataBindingUtil.setContentView(this, R.layout.game_detail);
        Intent intent = getIntent();
        race = (Race.RacelistBean) intent.getSerializableExtra("race");

        String str = race.getGame_pic().substring(52, race.getGame_pic().length());
        Picasso.with(this).load(str).into(binding.gamePic);

        binding.setDetail(race);

        binding.back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                onBackPressed();
                finish();
            }
        });

    }
}
